function GestureOptions()
{
	var ActionTypes = new Array();
	ActionTypes["NewTab"] = 0;
	ActionTypes["CloseTab"] = 1;
	ActionTypes["HistoryBack"] = 3;
	ActionTypes["HistoryForward"] = 4;
	
	var userGestures;
	var tailColor;
	
	function ArrayToString(arr) {
		var str = "";
		for (var key in arr) {
			if (str != "") { str += ","; }
			str += key + ":" + arr[key];
		}
		return str;
	}

	function StringToArray(str) {
		var arr = new Array();
		var pairs = str.split(",");
		for (i = 0; i < pairs.length; i++) {
			var pair = pairs[i].split(":");
			arr[pair[0]] = parseInt(pair[1]);
		}
		return arr;
	}
	
	function loadSettings() {
		var userGestureString = localStorage["userGestures"];
				
		if (userGestureString == null) {
			this.UserGestures = new Array(); 
			this.UserGestures["U"] = ActionTypes["NewTab"];
			this.UserGestures["D"] = ActionTypes["CloseTab"];
			this.UserGestures["L"] = ActionTypes["HistoryBack"];
			this.UserGestures["R"] = ActionTypes["HistoryForward"];
		} else {
			this.UserGestures = StringToArray(userGestureString);
		}				
		
		this.TailColor = localStorage["tailColor"];
		if (!this.TailColor)
			this.TailColor = "#ff0000";
	}
	
	function saveSettings(ug, tc) {
		localStorage["userGestures"] = ArrayToString(ug);
		localStorage["tailColor"] = tc;
		this.UserGestures = ug;
		this.TailColor = tc;
	}
	
	this.ActionTypes = ActionTypes;
	this.LoadSettings = loadSettings;
	this.SaveSettings = saveSettings;
	this.UserGestures = userGestures;
	this.TailColor = tailColor;
	
}